From e6812a869aa79b70b24be47440c2263ae483797c Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 26 Mar 2012 20:26:32 +0200 Subject: [PATCH] * (bug 35446) Using "{{nse:}}" with an invalid namespace name no longer throws a PHP warning Change-Id: I8e7611cdb03558af13ec5b96e02857ff5b16b571 --- HISTORY | 4 ++++ includes/parser/CoreParserFunctions.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index 14a80d05ff..e138ec05cb 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,10 @@ Change notes from older releases. For current info see RELEASE-NOTES-1.20. == MediaWiki 1.18 == +=== Changes since 1.18.2 === +* (bug 35446) Using "{{nse:}}" with an invalid namespace name no longer throws + a PHP warning. + === Changes since 1.18.1 === * (bug 33686) could not get a list of contributor for an article when using diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 0abfcef849..7614bf500b 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -141,7 +141,11 @@ class CoreParserFunctions { } static function nse( $parser, $part1 = '' ) { - return wfUrlencode( str_replace( ' ', '_', self::ns( $parser, $part1 ) ) ); + $ret = self::ns( $parser, $part1 ); + if ( is_string( $ret ) ) { + $ret = wfUrlencode( str_replace( ' ', '_', $ret ) ); + } + return $ret; } /** -- 2.20.1